<template>
  <div class="publish-container">
    <Tabs id="publish-tab" :value="activeTab" @on-click="handleTabClick">
      <TabPane label="商品管理" name="goods">
        <goods-management></goods-management>
      </TabPane>
      <TabPane label="拍卖品管理" name="bid">
        <bid-management></bid-management>
      </TabPane>
    </Tabs>
  </div>
</template>

<script>
import GoodsManagement from "../components/Goods_Management";
import BidManagement from "../components/Bid_Management";

export default {
  components: {
    GoodsManagement,
    BidManagement
  },
  computed: {
    activeTab() {
      if (this.$route.query.type == "goods") return "goods";
      else return "bid";
    }
  },
  methods: {
    handleTabClick(name) {
      this.$router.push({ path: "goods_management", query: { type: name } });
    }
  }
};
</script>

<style lang="scss" scoped>
.publish-container {
  width: 80%;
  padding: 20px;
}
</style>
